package org.jsbd.boss.common;

import javax.servlet.http.HttpServletRequest;

import org.jsbd.boss.domian.User;

public class ConstantsCmp {
  
  /**
   * mr同步结果0成功，1失败
   */
  public final static int MR_RESULT_SUCCESS = 0;
  public final static int MR_RESULT_FAIL = 1;
  
  /**
   * 运营商1移动2联通3电信
   */
  public final static int MR_SERVICE_YD=1;
  public final static int MR_SERVICE_LT=2;
  public final static int MR_SERVICE_DX=3;

  public final static String USER_SESSION_INFO  = "userSessionInfo";
  
  public static User getSessionUser(HttpServletRequest request) {
      return (User) (request.getSession().getAttribute(ConstantsCmp.USER_SESSION_INFO));
  }
  
  public final static int HTTP_OK=200;
  public final static String HTTP_OK_STR="200";
 
    public static final int HTTP_TYPE_GET=1;
    public static final int HTTP_TYPE_POST=2;
    
    public static final int HTTP_TIME_OUT=5000;
    
    public static final String HTTP_PARAM_PARAM="1";
    public static final String HTTP_PARAM_JSON="2";
    public static final String HTTP_PARAM_XML="3";
    /**
     * 咪咕刷渠道
     */
    public static final String PROTOCOL_TYPE_SMS = "SMS";  //表示sms的协议类型   
    public static final int PROTOCOL_FLOW_TYPE_NOT_INTERRUPT = 0;  //表示不中断
    public static final int PROTOCOL_FLOW_TYPE_INTERRUPT = 1;  //表示中断    
    public static final int PROTOCOL_NOT_NEED_DETAIL_RESULT_CODE = 0;  //表示不需要详细结果
    public static final int PROTOCOL_NEED_DETAIL_RESULT_CODE = 1;  //表示需要详细结果
    public static final int PROTOCOL_STOP_RESULT_CODE = 0;  //表示不继续请求
    public static final int PROTOCOL_CONTINUE_RESULT_CODE = 1;  //表示继续请求   
    
    public static final int MSG_SEND_TEXT_TYPE = 1;  //发送文本类型内容
    public static final int MSG_SEND_DATA_TYPE = 2;  //发送数据类型格式内容
    
    public static final int MG_CHANNEL_ZERO = 0;  //咪咕渠道零    
    /**
     * 1 请求，2结果  , 3成功
     */
    public static final int LOG_TYPE_REQ = 1;
    public static final int LOG_TYPE_RESULT = 2;
    public static final int LOG_TYPE_SUCCESS = 3;    
    public static final int LOG_TYPE_MG_FAILURE = 4;  
    public static final int LOG_TYPE_MG_GET_ACCOUNT = 5;       
    public static final int LOG_TYPE_MG_GET_ACCOUNT_FAILURE = 6;  
    public static final int LOG_TYPE_MG_SUCCESS = 7;  
    public static final int LOG_TYPE_DM_SUCCESS = 8; 
    public static final int LOG_TYPE_MU_GETTASK_SUCCESS = 9; 
    public static final int LOG_TYPE_MU_GETSENDSMSFAIL_TASK = 11; 
    public static final int LOG_TYPE_MU_GETRETENT_SUCCESS = 10; 
    //生成不需要发短信任务成功
    public static final int LOG_TYPE_NONEED_CREATESENDSMS_TASK = 12; 
    //模拟器获取到不需要发短信任务
    public static final int LOG_TYPE_NONEED_GETSENDSMS_TASK = 13; 
    
    //生成咪咕账号登陆的任务
    public static final int LOG_TYPE_MIGU_EMAIL_USER_TASK = 14; 
    /**
     * 6 咪咕登录成功，7咪咕登录异常
     */
    public static final int MG_LOGIN_SUCCESS = 6;    
    public static final int MG_LOGIN_EXCEPTION = 7;      
    
    /**
     * 0新增，1留存
     */
    public final static String add = "0";  
    public final static String retent = "1";    
    
    
    
    
    public static final String BUCKET_NAME="webmeng";
}
